package deweb.cimaplanning.reports.corn_position;

import java.math.BigDecimal;

import org.apache.commons.lang.StringUtils;

import com.cs.common.init.SystemParameterCollection;

public class PurchaseOrder {
	protected int purchaseOrderVersionId;
	protected int monthPeriodVersionId;
	protected int transportId;
	protected int cornTypeId;
	protected String code;
	protected int codeNumber;
	protected float capacity;
	protected double bushelPrice;
	/*
	 * Precio en tonelada del bushel
	 */
	protected double tonPrice;
	protected String cornOrigin;
	
	/*
	 * precio ponderado de las compras de futuros
	 */
	protected double futuresPrice;
	
	/*
	 * Toneladas compradas de futuros
	 */
	protected float futuresQuantity;
	
	/*
	 * precio ponderado de las compras de maiz spot
	 */
	protected double spotPrice;
	
	/*
	 * Toneladas compradas de spot
	 */
	protected float spotQuantity;
	
	/*
	 * Constante para indicar el tama;o del padding del codigo
	 */
	private static final String PADDING_FOR_CODE = "PADDING_FOR_CODE";
	
	/**
	 * Method 'PurchaseOrder'
	 * 
	 */
	public PurchaseOrder()
	{
	}

	/**
	 * @return the purchaseOrderVersionId
	 */
	public int getPurchaseOrderVersionId() {
		return purchaseOrderVersionId;
	}

	/**
	 * @param purchaseOrderVersionId the purchaseOrderVersionId to set
	 */
	public void setPurchaseOrderVersionId(int purchaseOrderVersionId) {
		this.purchaseOrderVersionId = purchaseOrderVersionId;
	}

	/**
	 * @return the monthPeriodVersionId
	 */
	public int getMonthPeriodVersionId() {
		return monthPeriodVersionId;
	}

	/**
	 * @param monthPeriodVersionId the monthPeriodVersionId to set
	 */
	public void setMonthPeriodVersionId(int monthPeriodVersionId) {
		this.monthPeriodVersionId = monthPeriodVersionId;
	}

	/**
	 * @return the transportId
	 */
	public int getTransportId() {
		return transportId;
	}

	/**
	 * @param transportId the transportId to set
	 */
	public void setTransportId(int transportId) {
		this.transportId = transportId;
	}

	/**
	 * @return the cornTypeId
	 */
	public int getCornTypeId() {
		return cornTypeId;
	}

	/**
	 * @param cornTypeId the cornTypeId to set
	 */
	public void setCornTypeId(int cornTypeId) {
		this.cornTypeId = cornTypeId;
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the codeNumber
	 */
	public int getCodeNumber() {
		return codeNumber;
	}

	/**
	 * @param codeNumber the codeNumber to set
	 */
	public void setCodeNumber(int codeNumber) {
		this.codeNumber = codeNumber;
	}
	
	/**
	 * @return the full purchase order's code
	 */
	public String getCodeFull(){
		return code + StringUtils.leftPad("" + codeNumber, 
//						SystemParameterCollection.getInstance().getSystemParameterBean(PADDING_FOR_CODE).getIntValue(), 
						3, 
						"0");
		//return code + myFormatter.format(codeNumber);
	}

	/**
	 * @return the capacity
	 */
	public float getCapacity() {
		return capacity;
	}

	/**
	 * @param capacity the capacity to set
	 */
	public void setCapacity(float capacity) {
		this.capacity = capacity;
	}

	/**
	 * @return the bushelPrice
	 */
	public double getBushelPrice() {
		return bushelPrice;
	}

	/**
	 * @param bushelPrice the bushelPrice to set
	 */
	public void setBushelPrice(double bushelPrice) {
		this.bushelPrice = bushelPrice;
	}

	/**
	 * @return the futuresPrice
	 */
	public double getFuturesPrice() {
		return futuresPrice;
	}

	/**
	 * @param futuresPrice the futuresPrice to set
	 */
	public void setFuturesPrice(double futuresPrice) {
		this.futuresPrice = futuresPrice;
	}

	/**
	 * @return the futuresQuantity
	 */
	public float getFuturesQuantity() {
		return futuresQuantity;
	}

	/**
	 * @param futuresQuantity the futuresQuantity to set
	 */
	public void setFuturesQuantity(float futuresQuantity) {
		this.futuresQuantity = futuresQuantity;
	}

	/**
	 * @return the spotPrice
	 */
	public double getSpotPrice() {
		return spotPrice;
	}

	/**
	 * @param spotPrice the spotPrice to set
	 */
	public void setSpotPrice(double spotPrice) {
		this.spotPrice = spotPrice;
	}

	/**
	 * @return the spotQuantity
	 */
	public float getSpotQuantity() {
		return spotQuantity;
	}

	/**
	 * @param spotQuantity the spotQuantity to set
	 */
	public void setSpotQuantity(float spotQuantity) {
		this.spotQuantity = spotQuantity;
	}

	/**
	 * @return the cornOrigin
	 */
	public String getCornOrigin() {
		return cornOrigin;
	}

	/**
	 * @param cornOrigin the cornOrigin to set
	 */
	public void setCornOrigin(String cornOrigin) {
		this.cornOrigin = cornOrigin;
	}	
}
